package com.sc.sc250601.cook.controller;

import com.sc.sc250601.cook.pojo.Like;
import com.sc.sc250601.cook.pojo.Result;
import com.sc.sc250601.cook.service.LikeService;
import com.sc.sc250601.cook.service.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.Action;

@RestController
@RequestMapping("/like")
public class LikeController {
    @Autowired
   private LikeService ls;
    @RequestMapping("/selectIsLike")//查看是否点赞
    public Result selectIsLike(@RequestBody Like like){
        Like l=ls.selectIsLike(like);
        if(l!=null){
            return new Result(1,"已点赞");
        }
        return new Result(0,"未点赞");
    }
}
